#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <direct.h>
#include "Init.h"

using namespace std;


        int Init::init(){
            FILE *fp;
            mkdir("git");
            fp=fopen("./git/branches","w");
            fclose(fp);
            fp=fopen("./.git/config","w");
            fp=fopen("./.git/description","w");
            fp=fopen("./.git/HEAD","w");

            mkdir("git/hooks");
            fp=fopen("./git/hooks/applypatch-msg.sample","w");
            fclose(fp);
            fp=fopen("./git/hooks/commit-msg.sample","w");
            fclose(fp);
            fp=fopen("./git/hooks/post-update.sample","w");
            fclose(fp);
            fp=fopen("./git/hooks/pre-applypatch.sample","w");
            fclose(fp);
            fp=fopen("./git/hooks/pre-commit.sample","w");
            fclose(fp);
            fp=fopen("./git/hooks/prepare-commit-msg.sample","w");
            fclose(fp);
            fp=fopen("./git/hooks/pre-push.sample","w");
            fclose(fp);
            fp=fopen("./git/hooks/pre-rebase.sample","w");
            fclose(fp);
            fp=fopen("./git/hooks/update.sample","w");
            fclose(fp);

            mkdir("git/info");
            fp=fopen("./git/info/exclude","w");
            fclose(fp);
            
            mkdir("git/objects");
            mkdir("git/objects/info");
            //fp=fopen("./git/objects/info","w");
            //fclose(fp);
            mkdir("git/objects/pack");
            //fp=fopen("./git/objects/pack","w");
            //fclose(fp);

            mkdir("git/refs");
            fp=fopen("./git/refs/heads","w");
            fclose(fp);
            fp=fopen("./git/refs/tags","w");
            fclose(fp);
            return 1;
        }
